package com.pinda.exception;

import com.pinda.dto.returndto.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalException {

    @ExceptionHandler(value = Exception.class)
    public R myException(Exception e) {
        e.printStackTrace();
        R<Object> r = R.error("ERROR");
        r.setFlag(false);
        return r;

    }

}
